﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace Cloak.Mvp.Autofac
{
	/// <summary>
	/// The point at which a named presenter is bound to a particular view instance
	/// </summary>
	public class NamedPresenterSite : PresenterSite
	{
		/// <summary>
		/// Initializes a site with the specified presenter type, name and view
		/// </summary>
		/// <param name="presenterType">The type of presenter which handles the view</param>
		/// <param name="name">The name of the presenter which handles the view</param>
		/// <param name="view">The view instance which is handled by the presenter</param>
		public NamedPresenterSite(Type type, string name, object view) : base(type, view)
		{
			Contract.Requires(name != null);

			Name = name;
		}

		/// <summary>
		/// Gets the name of the presenter which handles the view
		/// </summary>
		public string Name { get; private set; }
	}
}